/* arch/i386/kernel/arch_mm.c 
 * 
 * This file is part of xnix. 
 * 
 * XNIX is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version. 
 * 
 * XNIX is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with XNIX. If not, see <https://www.gnu.org/licenses/>
 */ 




#include <kernel/init.h>
#include <kernel/module.h>

#include <kernel/mm.h>
#include <kernel/arch_mm.h>

#include <sys/types.h>


int arch_mm_init(void) {
	/* parse the e820 info, and save. */

	struct e820_entry *entry = E820_ADDR;
	int i;

	
	for (i = 0; i < 32; i++) {
		if (!entry->type) 
			break;

		if (entry->type == E820_TYPE_RAM) 
			total_ram += entry->sizel;

		entry++;
	}

	return 0;
}


arch_init(arch_mm_init);

